package com.javaclimb.music.datastructure;

import java.util.Arrays;
import java.util.Stack;

public class StringStack{
    public static void main(String[] args) {
        Stack stack=new Stack();
        String s="how are you";
        System.out.println("反正转："+s);
        char[] ca=s.toCharArray();
        for (int i=0;i< ca.length;i++){
            stack.push(ca[i]);
        }
        for (int i=0;i< ca.length;i++){
            ca[i]= (char) stack.pop();
        }
        s=String.valueOf(ca);
        System.out.println("反转后："+s);
    }
}
